# not working for $a=@("new-item -itemtype Directory -path c:\abc","new-item -itemtype file -path c:\abc\test.txt")
# curly braces must  be used to new-item cmdlet
$a=@({new-item -itemtype Directory -path 'c:\ac'},{new-item -itemtype file -path 'c:\ac\test.txt'})
foreach($b in $a)
{
    & $b
}

# working for below one

<#
$a = @(
    { New-Item -ItemType Directory -Path "C:\abc" },
    { New-Item -ItemType File -Path "C:\abc\test.txt" }
)

foreach ($b in $a) {
    & $b
}
#>

# working for below two, recommended
<#
$a = @(
    { New-Item -ItemType Directory -Path "C:\ab" -Force},

    {New-Item -ItemType File -Path "C:\ab\tt.txt" -Force}
)

$a | ForEach-Object { & $_ }
#>


# static method, .. to assign multiple commands to a variable and execute them later
$a=1..5
$a  